<?php
namespace Admin\Model;
use Think\Model\RelationModel;

class LogicClassStudentModel extends RelationModel {

	protected $_validate = array(
		array('id', 'require', 'id不能为空！'),
		array('student_id', 'require', '学生不能为空！', 1),
		array('logic_class_id', 'require', '逻辑班级不能为空！', 1),
	);

	public function checkUnique($logicClassStuent) {
		$map['logic_class_id'] = $logicClassStuent['logic_class_id'];
		$map['student_id'] = $logicClassStuent['student_id'];
		$result = $this->where($map)->find();
		return !$result;
	}

}
